package com.chendx.store.user.controller;

import com.chendx.model.common.dtos.ResponseResult;
import com.chendx.store.user.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Created by chendx on 2022/4/28.
 */
@RestController
@RequestMapping("/api/notice")
public class NoticeController {

    @Autowired
    private NoticeService noticeService;

    @PostMapping("/send")
    public ResponseResult send(String customer, @RequestBody Map map){

        return noticeService.send(map,customer);
    }


    @GetMapping("/getNotice")
    public ResponseResult getNotice(String customer){
        return noticeService.getNotice(customer);
    }



    @GetMapping("/getNoticeCount")
    public ResponseResult getNoticeCount(String customer){
        return noticeService.getNoticeCount(customer);
    }

    @GetMapping("/readNotice")
    public ResponseResult readNotice(String customer){
        return noticeService.readNotice(customer);
    }
}
